import {
  Config
} from "../../../utils/config.js";
import api from "../../../utils/api.js"
import * as com from "../../../utils/common.js"
const Base = new com.Base();
var app = getApp();

Page({

  data: {
    userInfo: null,
    isLogin: false
  },

  onLoad() {
    this.getUserInfo();
  },

  onShow() {
    this.getUserInfo();
    this.isLogin();
  },

  // 游客信息
  getUserInfo() {
    this.setData({
      userInfo: app.globalData.userInfo
    })
  },

  // 是否授权登录
  isLogin() {
    var that = this
    // 是否授权
    wx.getSetting({
      success: function(res) {
        console.log(res)
        if (res.authSetting['scope.userInfo']) {
          that.setData({
            isLogin: true
          })
        }
      }
    })
  },

  // 点击登录
  goLogin() {
    wx.navigateTo({
      url: '/pages/about_index/login/login'
    })
  }


})